package com.mingqijia.gassafety.shared.constant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author zhangfei
 * @version 1.0.0
 * @ClassName CallTypeEnum.java
 * @Description TODO
 * @createTime 2023年12月18日
 */
@Getter
@RequiredArgsConstructor
public enum CallTypeEnum {
    CALL_99(99, 1, "gassafety_call_task","[\"客户手机号码\",\"安装地址\",\"燃气公司名\",\"公司电话\"]","报警器外呼机器人"),
    CALL_0(1,2, "gassafety_call_breakdown_task","[\"燃气公司名\",\"安装地址\",\"燃气公司名\",\"公司电话\",\"客户手机号码\"]","故障通知_策略"),
    CALL_1(0,5, "gassafety_call_offline_task","[\"燃气公司名\",\"安装地址\",\"燃气公司名\",\"公司电话\",\"客户手机号码\"]","离线通知_策略"),
    CALL_2(2,4, "gassafety_call_report_task","[\"燃气公司名\",\"安装地址\",\"燃气公司名\",\"日期\",\"客户手机号码\"]","设备运行报告_策略"),
    CALL_3(3,11, "gassafety_call_service_task","[\"燃气公司名\",\"安装地址\",\"动词\",\"服务到期日期\",\"公司电话\",\"客户手机号码\"]","服务到期提醒_策略");

    private final int code;
    private final int appId;
    private final String taskCode;
    private final String callColumn;
    private final String taskName;

    public static CallTypeEnum getPushTypes(int code) {
        for (CallTypeEnum dtuPushTypeEnum : CallTypeEnum.values()) {
            if (dtuPushTypeEnum.getCode()==(code)) return dtuPushTypeEnum;
        }
        return null;
    }

    public static CallTypeEnum getPushTypesByTaskCode(String taskCode) {
        for (CallTypeEnum dtuPushTypeEnum : CallTypeEnum.values()) {
            if (dtuPushTypeEnum.getTaskCode().equals(taskCode)) return dtuPushTypeEnum;
        }
        return null;
    }

}
